package vtt.android.lichphatsongbd.fragments;

import java.util.List;

import vtt.android.lichphatsongbd.Constants;
import vtt.android.lichphatsongbd.adapters.RssAdapter;
import vtt.android.rsslib.RssItem;
import android.os.Bundle;

public class TinTheThaoSumaryListFragment extends BaseTinTheThaoFragment {
    
    public static TinTheThaoSumaryListFragment newInstance(int sectionNumber) {
        TinTheThaoSumaryListFragment fragment = new TinTheThaoSumaryListFragment();
        Bundle args = new Bundle();
        args.putInt(ARG_SECTION_NUMBER, sectionNumber);
        fragment.setArguments(args);
        return fragment;
    }

    @Override
    protected void updateListData(List<RssItem> result) {
        // only get 10 items every page
        for (int i = 0; i < Constants.NUM_PER_PAGE; i++) {
            if (result.size() > 0 && i < result.size()) {
                if (i == 0) {
                    RssItem adItem = new RssItem();
                    adItem.setTitle(RssAdapter.SHOW_ADMOB);
                    mItemList.add(adItem);
                }
                mItemList.add(result.get(i));
            } else {
                break;
            }
        }
    }

    @Override
    public String[] getRssResoureList() {
        return new String[] { 
                "http://www.24h.com.vn/upload/rss/bongda.rss", 
                "http://vnexpress.net/rss/the-thao.rss",
                "http://thethaovanhoa.vn/trang-chu.rss",
                "http://dantri.com.vn/The-Thao.rss",
                "http://bongdaplus.vn/rss/trang-chu.rss",
                "http://thethao247.vn/home.rss",
                "http://www.Bongda.com.vn/Rss/", 
//              "http://thethao.tuoitre.vn/trang/rss",
//              "http://soha.vn/the-thao.rss",
        };
    }

    @Override
    public boolean isShowHeader() {
        return true;
    }
}
